package com.lanou3g.myapplication.activity.singleton.activity;

import android.content.Intent;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import com.lanou3g.myapplication.DayNightMode;
import com.lanou3g.myapplication.R;

/**
 * Created by dllo on 16/1/15.
 */
public class SettingActivity extends BaseActivity implements View.OnClickListener {


    @Override
    protected int setLayout() {
        return R.layout.activity_setting;
    }

    @Override
    protected void initView() {
        findViewById(R.id.setting_btn_night).setOnClickListener(this);

    }

    @Override
    protected void initData() {

    }

    @Override
    public void onClick(View v) {
        int theme = DayNightMode.getDayNightMode(this);
        switch (v.getId()) {
            case R.id.setting_btn_night:
                BaseActivity.nightDate();
                MainActivity.mainActivity.finish();
                this.finish();
                Log.d("SettingActivity", "刷新");
                this.startActivity(new Intent(this, MainActivity.class));

                Intent intent = new Intent(this, MainActivity.class);
                Log.d("SettingActivity", "刷新2");

                startActivity(intent);
                finish();

                break;
        }
    }
}
